]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ibusCandidatePopup: Fix scaling set-cursor-location-relative signal handling
authorTakao Fujiwara <tfujiwar@redhat.com>
Wed, 27 Aug 2025 09:00:30 +0000 (18:00 +0900)
committerTakao Fujiwara <tfujiwar@redhat.com>
Wed, 27 Aug 2025 09:00:30 +0000 (18:00 +0900)
Need to convert the raw coordinates to the scaled ones in gnome-shell.
IBus GtkIMModule can calculate the relative coordinates and gnome-shell
needs to provide the actual scale.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8424
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3729>

js/ui/ibusCandidatePopup.js

index 0bb4e47ee2e8e155d92cb5aa972123763d6a258c..6389f558e5ee769efa978ed4eae4f02674417d50 100644 (file)
@@ -222,11 +222,13 @@ class IbusCandidatePopup extends BoxPointer.BoxPointer {
                 let rect = new Mtk.Rectangle({x, y, width: w, height: h});
                 rect = focusWindow.protocol_to_stage_rect(rect);
                 const windowActor = focusWindow.get_compositor_private();
+                // IBus GtkIMModule cannot get the shell scale.
+                const scale = windowActor.get_resource_scale();
                 this._setDummyCursorGeometry(
-                    windowActor.x + rect.x,
-                    windowActor.y + rect.y,
-                    rect.width,
-                    rect.height);
+                    windowActor.x + rect.x / scale,
+                    windowActor.y + rect.y / scale,
+                    rect.width / scale,
+                    rect.height / scale);
             });
         } catch {
             // Only recent IBus versions have support for this signal